package com.fei.controller;

import com.fei.service.DoubleVideoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/file")
@Slf4j
public class DoubleVideoController {
    @Autowired
    private DoubleVideoService doubleRecordingService;

    /**
     * 第一步：视频上传
     * 第二步：通知接口【查看视频是否上传成功】
     * 第三步：暂存数据
     * @param file
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "videoMountAll",method = RequestMethod.POST)
    public String videoMount(@RequestParam("file") MultipartFile file) throws Exception {
        //异步视频上传
        doubleRecordingService.doubleRecordTest("", "", file);
        return "redirect:/";
    }
}
